package cn.yr.oss;

import java.io.File;
import java.io.InputStream;

/**
 * @ClassName : OssKit
 * @Description : 工具类
 * @Author : Lang
 * @Date: 2020-03-07 13:30
 */
public class OssKit {

    private Oss oss;

    public void setOss(Oss oss) {
        if (oss == null) {
            throw new IllegalArgumentException("oss can not be null.");
        }
        this.oss = oss;
    }

    public String upload(File targetFile){
        return  oss.upload(targetFile);
    }

    public String upload(File targetFile, String resourcesName){
        return  oss.upload(targetFile,resourcesName);
    }

    public String upload(String targetName, String resourcesName){
        return  oss.upload(targetName,resourcesName);
    }

    public String upload(byte[] data,String targetName){
        return oss.upload(data,targetName);
    }
    public String upload(InputStream inputStream, String targetName){
        return oss.upload(inputStream,targetName);
    }
}
